{extend name="index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">数据统计</div>
    <div class="layui-card-body">
        <div class="layui-form">
            <table class="layui-hide" id="currentTable" lay-filter="currentTable"
                   data-auth-add="{:$auth->check('statistics/add')}"
                   data-auth-edit="{:$auth->check('statistics/edit')}"
                   data-auth-delete="{:$auth->check('statistics/del')}"
                   data-auth-recyclebin="{:$auth->check('statistics/recyclebin')}"
            ></table>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    layui.use('yznTable', function () {
        var table = layui.yznTable;

        var init = {
            table_elem: '#currentTable',
            table_render_id: 'currentTable',
            add_url: '{:url("add")}',
            edit_url: '{:url("edit")}',
            delete_url: '{:url("del")}',
            modify_url: "{:url('multi')}",
            recyclebin_url: "{:url('recyclebin')}",
        };

        table.render({
            init: init,
            toolbar: ['refresh'],
            url: '{:url("index")}',
            where: {sort:'date'},
            cols: [
                [
                    {type: 'checkbox', fixed: 'left'},
                    {field: 'id', align: 'center',title: 'id', minWidth: 80,search: false},
                    {field: 'date', align: 'center',title: '日期', minWidth: 80, width: 180, search: 'range'},
                    {field: 'total_amount', align: 'center',title: '总收入', minWidth: 80, searchTip: '总收入',search: false},
                    {field: 'total_nums',align: 'center', title: '总单数', minWidth: 80,search: false},
                    {field: 'total_user', align: 'center',title: '总支付人数', minWidth: 100,search: false},
                    {
                        field: 'spec_amount',
                        title: '专项服务收入',
                        align: 'center',
                        minWidth: 140,
                        search: false,
                        searchTip: '专项服务收入'
                    },
                    {field: 'spec_nums', align: 'center',search: false,title: '专项服务单数',  minWidth: 140,},
                    {field: 'spec_user', align: 'center',search: false,title: '专项服务支付人数',  minWidth: 160,},
                    {
                        field: 'package_amount',
                        title: '企服套餐总金额',
                        minWidth: 140,
                        align: 'center',
                        search: false,
                        searchTip: '企服套餐收入'
                    },
                    {field: 'package_nums', align: 'center',search: false,title: '企服套餐单数', minWidth: 140},
                    {field: 'package_user', align: 'center',search: false,title: '企服支付人数', minWidth: 140},
                    {
                        field: 'goods_amount',
                        title: '商城收入总额',
                        minWidth: 140,
                        align: 'center',
                        search: false,
                        searchTip: '商城收入总额'
                    },
                    {field: 'goods_nums', align: 'center',search: false,title: '商品支付单数', minWidth: 140},
                    {field: 'goods_user', align: 'center',search: false,title: '商品支付人数', minWidth: 140},
                    {
                        field: 'vip_amount',
                        title: 'VIP收入总额',
                        minWidth: 140,
                        align: 'center',
                        search: false,
                        searchTip: 'VIP收入总额'
                    },
                    {field: 'vip_nums', align: 'center',search: false,title: 'VIP支付单数', minWidth: 140},
                    {field: 'vip_user', align: 'center',search: false,title: 'VIP支付人数', minWidth: 140},
                    // {fixed: 'right',width:90,field: 'operate', title: '操作',templet: yznTable.formatter.tool,operat: ['edit','delete']}
                ]
            ],
            page: {}
        });

        yznTable.bindevent();
    });
</script>
{/block}